﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
using System.Windows.Forms;


namespace littleAdminHelper
{
    class registry
    {
        private registry()
        {
        }

        public static Boolean valueExists(String path, String value)
        {
            try
            {

                String result = Registry.GetValue(path, value, -1).ToString();
                if (result == "-1")
                {
                    return false;
                }
                else
                {
                    return true;
                }
               
            }
            catch (Exception e)
            {
                //MessageBox.Show("Error Loading Registry Key!");
                return false;
            }

           
        }

        public static String getValue(String path,String value)
        {
            try
            {
                String result = Registry.GetValue(path, value, -1).ToString();
                if (result == "-1")
                {
                    return "does not exist";
                }
                else
                {
                    return result;
                }

            }
            catch (Exception e)
            {
                MessageBox.Show("Error getting Registry Informations");
                return null;
            }

            
        }

    }
}
